import React, { Component } from 'react'
import { NavBar, Icon } from 'antd-mobile';
import { withRouter } from 'react-router-dom'

@withRouter
export default class header extends Component {
    searchClickHandler=()=>{
        this.props.history.push('/search')
    }
    render() {
        return (
            <div style={{
                position: "relative",
                zIndex: '10000',
            }}>
                <NavBar
                    mode="light"
                    leftContent={
                        this.props.children
                    }
                    rightContent={
                        <i className="yo-ico"
                            style={
                                {
                                    fontSize: '0.22rem',
                                    color: '#fff',
                                }
                            }
                            onClick={this.searchClickHandler}
                        >&#xe671;
                        </i>}
                    style={
                        {
                            background: '#2e59e6',
                            color: "#fff"
                        }
                    }
                >{this.props.title}</NavBar>
            </div>
        )
    }
}
